import { NavBar, Space, Toast } from 'antd-mobile'
import { MoreOutline, SearchOutline } from 'antd-mobile-icons'
import React from 'react'
import { useNavigate } from 'react-router-dom'


import './style.less'

export default ({ title }) => {

    const navgate = useNavigate()

    const right = (
        <div style={{ fontSize: 24 }}>
            <Space style={{ '--gap': '16px' }}>
                <SearchOutline />
                <MoreOutline />
            </Space>
        </div>
    )

    const back = () => {
        console.log("click back");
        navgate(-1)
    }


    return (
        <>
            <NavBar
                style={{
                    '--height': '36px',
                    '--border-bottom': '1px #eee solid',
                }}
                onBack={back}
            >
                {title}
            </NavBar>
        </>
    )
}